<!DOCTYPE html>
<%@page import="ansi.modelo.Residente"%>
<%@page import="java.util.Collection"%>
<%@page import="ansi.modelo.AreaComun"%>
<html lang="en">
<jsp:include page="cabeceraHead.jsp"></jsp:include>
	<body>
		<jsp:include page="cabeceraMenu.jsp"></jsp:include>
		<div class="container">
			<h2>Registro de reserva</h2>
			<br/>
			<form id="form1" name="form1" method="post" action="ReservaRegistroServlet">
				<table width="300" height="104" border="1" cellpadding="0" cellspacing="0">
					<tr>
						<td>Id:</td>
						<td><label>< Correlativo ></label></td>
					</tr>
					<tr>
						<td>Estado:</td>
						<td>
							<select name="Estado_Reserva">
								<option value="Reservado" selected="selected">Reservado</option>
								<option value="Libre">Libre</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>Hora inicio:</td>
						<td>
							<input name="Hora_Inicio" />&nbsp;&nbsp;Formato: HH24:MI
						</td>
					</tr>
					<tr>
						<td>Hora fin:</td>
						<td>
							<input name="Hora_Fin" />&nbsp;&nbsp;Formato: HH24:MI
						</td>
					</tr>
					<tr>
						<td>Fecha:</td>
						<td>
							<input name="Fecha_Reserva" />&nbsp;&nbsp;Formato: DD/MM/YYYY
						</td>
					</tr>
					<tr>
						<td>Residente:</td>
						<td>
							<select name="Residente_DNI_Residente">
							<%
							Collection<Residente> listResidente	= (Collection<Residente>)request.getAttribute("listResidente");
							if(listResidente != null) for(Residente residente:listResidente) { %>
								<option value="<%=residente.getDNI_Residente() %>"><%=residente.getNombre_Residente() %></option>
							<%}%>
							</select>
						</td>
					</tr>
					<tr>
						<td>Area comun:</td>
						<td>
							<select name="Area_Comun_idArea_Comun">
							<%
							Collection<AreaComun> listAreaComun	= (Collection<AreaComun>)request.getAttribute("listAreaComun");
							if(listAreaComun != null) for(AreaComun areaComun:listAreaComun) { %>
								<option value="<%=areaComun.getIdArea_Comun() %>"><%=areaComun.getDescripcion_Area_Comun() %></option>
							<%}%>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<input type="submit" value="Guardar" />
							<input type="button" value="Regresar" onclick="window.location='ReservaBuscarServlet' " />
						</td>
					</tr>
				</table> 
				<p>&nbsp;</p>
			</form>
			<!-- Site footer -->
			<div class="footer">
				<p>&nbsp;</p>
				<p>&copy; RCondezo 2014 </p>
			</div>
		</div>
	</body>
</html>